*------------------------------------------------------------------------------*
* 	Table 8: Treatment Effects - OLS		 	   *
*------------------------------------------------------------------------------*
{
cd "$data"
use ExperimentalData_Applications_NonAttrit, clear

*********Columns (1), (2), (3)
sort aux_id

local off_female off_female
local regionbankfeall d_region_bank_fe_all1-d_region_bank_fe_all54
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfe d_week1-d_week22
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio 

foreach outcome of varlist application_responded if_asked_more application_approved {
            
			*Standard Errors clustered at the bank-branch level (in parenthesis)
			regress `outcome' app_female##treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio', cluster(region_bank_fe)
			sum `outcome' if app_female==0 & treat==0
			local mean_male2 = r(mean)	
			outreg2 1.app_female 1.treat 1.app_female#1.treat using "${tables}/Table8_cols_1_2_3_cse.xls", keep(1.app_female 1.treat 1.app_female#1.treat) addstat("mean_control_male", `mean_male2') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"  
			*Bootstrapped Standard Errors (in brackets)
			regress `outcome' app_female##treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio',  vce(boot, rep(3000) seed(10101010))
			outreg2 1.app_female 1.treat 1.app_female#1.treat using "${tables}/Table8_cols_1_2_3_bse.xls", keep(1.app_female 1.treat 1.app_female#1.treat) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"
			}

*Multiple Hypotheses Testing: MHT p-val. follows List et al. (2021), Theorem 3.1., to report the multiplicity adjusted p-value for multiple hypothesis testing of H0: \beta_Fem.App X Treat = 0 across the specified outcomes and subgroups, controlling for the specified covariates (3,000 reps.).

gen d_fem_treat = (app_female==1 & treat==1)

sort aux_id

local off_female off_female
local regionbankfeall d_region_bank_fe_all1-d_region_bank_fe_all54
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfe d_week1-d_week22
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio

*(1) - (3) MHT p-v. (bt)

mhtreg (application_responded d_fem_treat app_female treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio') ///
        (if_asked_more d_fem_treat app_female treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio') ///
	    (application_approved d_fem_treat app_female treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio'), /// 
	   seed(10101010) bootstrap(3000)

	   
	   
*********Columns (4), (5), (6)

sort aux_id

local off_female off_female
local regionbankfemis d_region_bank_fe_mis1-d_region_bank_fe_mis24
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfemis d_weekfe_mis1-d_weekfe_mis21
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio 
			
foreach outcome of varlist application_responded if_asked_more application_approved {
            
			*Standard Errors clustered at the bank-branch level (in parenthesis)
            regress `outcome' app_female##treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1, cluster(region_bank_fe)
			sum `outcome' if app_female==0 & treat==0 & mis_with_treat_message==1
			local mean_male2 = r(mean)	
			outreg2 1.app_female 1.treat 1.app_female#1.treat using "${tables}/Table8_cols_4_5_6_cse.xls", keep(1.app_female 1.treat 1.app_female#1.treat) addstat("mean_control_male", `mean_male2') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append" 
			
			*Bootstrapped Standard Errors (in brackets)
            regress `outcome' app_female##treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1,  vce(boot, rep(3000) seed(10101010))
			outreg2 1.app_female 1.treat 1.app_female#1.treat using "${tables}/Table8_cols_4_5_6_bse.xls", keep(1.app_female 1.treat 1.app_female#1.treat) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"   

}

			
*Multiple Hypotheses Testing: MHT p-val. follows List et al. (2021), Theorem 3.1., to report the multiplicity adjusted p-value for multiple hypothesis testing of H0: \beta_Fem.App X Treat = 0 across the specified outcomes and subgroups, controlling for the specified covariates (3,000 reps.).

sort aux_id

local off_female off_female
local regionbankfemis d_region_bank_fe_mis1-d_region_bank_fe_mis24
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfemis d_weekfe_mis1-d_weekfe_mis21
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio 

*(4) - (6) MHT p-v. (bt)

mhtreg (application_responded d_fem_treat app_female treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1) ///
        (if_asked_more d_fem_treat app_female treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1) ///
	    (application_approved d_fem_treat app_female treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1), /// 
	   seed(10101010) bootstrap(3000)
		
			
			
*********Columns (7), (8), (9)

sort aux_id
			
local off_female off_female
local regionbankfenmis d_region_bank_fe_nmis1-d_region_bank_fe_nmis54
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfe d_week1-d_week22
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio			
			
			
foreach outcome of varlist application_responded if_asked_more application_approved {
            
			*Standard Errors clustered at the bank-branch level (in parenthesis)
	         regress `outcome' app_female##treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==0, cluster(region_bank_fe)
			sum `outcome' if app_female==0 & treat==0 & mis_with_treat_message==0
			local mean_male2 = r(mean)	
			outreg2 1.app_female 1.treat 1.app_female#1.treat using "${tables}/Table8_cols_7_8_9_cse.xls", keep(1.app_female 1.treat 1.app_female#1.treat) addstat("mean_control_male", `mean_male2') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"					
			
 			*Bootstrapped Standard Errors (in brackets)
             regress `outcome' app_female##treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==0,  vce(boot, rep(3000) seed(10101010))
			outreg2 1.app_female 1.treat 1.app_female#1.treat using "${tables}/Table8_cols_7_8_9_bse.xls", keep(1.app_female 1.treat 1.app_female#1.treat) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"
			
			
}			
			
			
*Multiple Hypotheses Testing: MHT p-val. follows List et al. (2021), Theorem 3.1., to report the multiplicity adjusted p-value for multiple hypothesis testing of H0: \beta_Fem.App X Treat = 0 across the specified outcomes and subgroups, controlling for the specified covariates (3,000 reps.).

sort aux_id

local off_female off_female
local regionbankfenmis d_region_bank_fe_nmis1-d_region_bank_fe_nmis54
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfe d_week1-d_week22
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio			
			
*(7) - (9) MHT p-v. (bt)

mhtreg (application_responded d_fem_treat app_female treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==0) ///
       (if_asked_more d_fem_treat app_female treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==0) ///
	   (application_approved d_fem_treat app_female treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==0), /// 
	   seed(10101010) bootstrap(3000)


	   
*Multiple Hypotheses Testing: MHT p-val. follows List et al. (2021), Theorem 3.1., to report the multiplicity adjusted p-value for multiple hypothesis testing of H0: \beta_Fem.App X Treat = 0 across the specified outcomes and subgroups, controlling for the specified covariates (3,000 reps.).

sort aux_id
	   
local off_female off_female
local loanamount credit_asked_ammount_cat1-credit_asked_ammount_cat8   
local weekfe d_week1-d_week22
local indivcovariates app_age_below_29 app_age_29_38 app_married app_wage_600_1200 app_wage_above_1200 app_self_employed app_bank_client d_miss_app_married d_miss_app_self_employed
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12 off_age_18_28 off_age_29_48 
local pro_male_portfolio pro_male_portfolio 

local regionbankfeall d_region_bank_fe_all1-d_region_bank_fe_all54
local regionbankfemis d_region_bank_fe_mis1-d_region_bank_fe_mis24
local weekfemis d_weekfe_mis1-d_weekfe_mis21
local regionbankfenmis d_region_bank_fe_nmis1-d_region_bank_fe_nmis54


*(1), (4), (7) MHT p-v. (bt)

 mhtreg (application_responded d_fem_treat app_female treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio') ///
        (application_responded d_fem_treat app_female treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1) ///
	    (application_responded d_fem_treat app_female treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio'  if mis_with_treat_message==0), /// 
	   seed(1010101010) bootstrap(3000)
		

*(2), (5), (8) MHT p-v. (bt)

 mhtreg (if_asked_more d_fem_treat app_female treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio') ///
        (if_asked_more d_fem_treat app_female treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1) ///
	    (if_asked_more d_fem_treat app_female treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio'  if mis_with_treat_message==0), /// 
	   seed(1010101010) bootstrap(3000)

		
*(3), (6), (9) MHT p-v. (bt)

 mhtreg (application_approved d_fem_treat app_female treat `off_female' `regionbankfeall' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio') ///
        (application_approved d_fem_treat app_female treat `off_female' `regionbankfemis' `loanamount' `weekfemis' `indivcovariates' `execcovariates' `pro_male_portfolio' if mis_with_treat_message==1) ///
	    (application_approved d_fem_treat app_female treat `off_female' `regionbankfenmis' `loanamount' `weekfe' `indivcovariates' `execcovariates' `pro_male_portfolio'  if mis_with_treat_message==0), /// 
	   seed(1010101010) bootstrap(3000)		
	   


}
        

